package com.atguigu;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidPooledConnection;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.sql.SQLException;

@SpringBootApplication
public class Day13SpringBootDemoApplication {

    public static void main(String[] args) throws SQLException {

        ConfigurableApplicationContext ioc = SpringApplication.run(Day13SpringBootDemoApplication.class, args);
        DruidDataSource dataSource = ioc.getBean(DruidDataSource.class);
        DruidPooledConnection connection = dataSource.getConnection();
        System.out.println("connection = " + connection);
    }

}
